<template>
    <div>
      <table border="1">
        <tr>
          <th>图片</th>
          <th>名称</th>
          <th>价格</th>
          <th>用户名</th>
          <th>评论内容</th>
          <th>评论时间</th>
        </tr>
        <tr v-for="a in commentlist">
          <td>{{ a.title }}</td>
          <td><img :src="'http://localhost:8000/static/upload/'+a.img" width="50px"></td>
          <td>{{ a.price }}</td>
          <td>{{ a.username }}</td>
          <td>{{ a.content }}</td>
          <td>{{ a.crerta_time }}</td>
        </tr>
      </table>


    </div>
</template>

<script>
    export default {
        name: "allcomment",
      data(){
          return{
            commentlist:[],
          }
      },
      mounted() {
          this.get_comment();
      },
      methods:{
          get_comment:function () {

            //发送请求
              this.axios.get('http://localhost:8000/commentlist/').then((res) =>{

              console.log(res);

              //赋值 后端传给前端空列表
              this.commentlist = res.data.data;




			});



          }
      }
    }
</script>

<style scoped>

</style>
